<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head  th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" th:href="@{/css/me.css}">
    <title>搜索结果</title>
</head>
<body>
<!--    导航-->
<!--    inverted：反转颜色-->
<!--    attached：使圆滑弧形变方-->
    <nav  th:replace="_fragments :: menu(1)"></nav>

<!--    中间内容-->
    <div class="m-container-small m-padded-tb-big">
        <div class="ui container">
            <div class="ui top attached segment">
                <div class="ui middle aligned two column grid">
                    <div class="column">
                        <h3 class="ui teal header">搜索结果</h3>
                    </div>
                    <div class="right aligned column">
                        共 <h2 class="ui orange header m-lined-block m-text-thin" th:text="${page.totalElements}"></h2> 个
                    </div>
                </div>
            </div>


            <div class="ui top attached teal segment">
                <div class="ui padded vertical segment m-padded-tb-large" th:each="blog : ${page.content}">
                    <div class="ui middle aligned mobile reversed stackable grid" >
                        <div class="eleven wide column">
                            <h3 class="ui header"><a th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="m-black" th:text="${blog.title}"></a></h3>
                            <a th:href="@{/blog/{id}(id=${blog.id})}"><p class="m-text" th:text="|${blog.description}...|"></t></p></a>
                            <div class="ui grid">
                                <div class="eleven wide column">
                                    <div class="ui mini horizontal link list">
                                        <div class="item">
                                            <img src="https://picsum.photos/id/0/100/100" alt="" class="ui avatar image" th:src="@{${blog.user.avatar}}">
                                            <div class="content"><a href="#" class="header" th:text="${blog.user.nickname}"></a></div>
                                        </div>
                                        <div class="item">
                                            <i class="calendar icon" ></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}"></span>
                                        </div>
                                        <div class="item">
                                            <i class="eye icon"></i>&nbsp;&nbsp;<span th:text="${blog.views}"></span>
                                        </div>
                                    </div>
                                </div>
                                <div class="right aligned five wide column">
                                    <a href="" target="_blank" class="ui teal basic label m-padded-mini" th:text="${blog.type.name}"></a>
                                </div>
                            </div>
                        </div>

                        <div class="ui five wide column">
                            <a th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                                <img src="https://picsum.photos/id/1/800/400" alt="" class="ui rounded image" th:src="@{${blog.firstPicture}}">
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="ui bottom attached segment" th:if="${page.totalPages}>1">
                <div class="ui middle aligned two column grid">
                    <div class="column">
                        <a th:href="@{/(page=${page.number}-1)}" th:unless="${page.first}" class="ui mini teal basic button">上一页</a>
                    </div>
                    <div class="right aligned column">
                        <a th:href="@{/(page=${page.number}+1)}" th:unless="${page.last}" class="ui mini teal basic button">下一页</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </br>
<!--    底部-->
    <footer th:replace="_fragments :: footer"></footer>
<!--/*/<th:block th:replace="_fragments :: script">/*/-->
<!--/*/</th:block>/*/-->
<script>
    $('.menu.toggle').click(function (){
        $('.m-item').toggleClass('m-mobile-hide');
    });


</script>
</body>
</html>